{% extends "base.html" %}

{% block extrahead %} {% endblock %}

{% block head %}
  {{ head }}
{% endblock %}

{% block content  %}
{% block preform  %}
	{% if missatge %}
		<div class="info">
		{{missatge}}
		</div>
	{% endif %}
{% endblock %}
<form method="post" action="">{% csrf_token %}
<table class="form">
    {{ formset.management_form }}
    {% for form in formset %}    

        {%if form.formSetDelimited %} 
           <tr style='background-color:black; height='10'><td colspan='2' style='background-color:black; height='10'></td></tr> 
        {% endif %}       
  					
        {% if form.non_field_errors %}
		 <tr> <td colspan="2" >
		  <div class="conte_errors">
		  <ul style="margin: 0px">
	      {% for error in form.non_field_errors %}
	      	<li>{{error}}</li>
	      {% endfor %}
	      <ul>
	      </div>
	     </td></tr>
	    {% endif %}	
	    
		{% for label, value in form.infoForm %}
		<tr>
		    <td class="label_tag">
		    	{{ label }}:
		    </td>
		    <td>       
		        {{ value }}
		    </td>
		</tr>
		{% endfor %}		
			    
	    {% for hidden in form.hidden_fields %}
                {{ hidden }}
        {% endfor %}
        
        {% for field in form.visible_fields %}
        
			<tr>		
			    <td class="label_tag">{{ field.label_tag }}:</td>
			    <td class="tria_tag" {% if field.errors %} class="conte_errors"  {% endif %}  >		        
			        {{ field }}
			        {% if field.help_text %}
			        <br/><span class="help_text">( {{ field.help_text }} )</span>
			        {% endif %}
			    	{{ field.errors }}
			    </td>
			</tr>
        {% endfor %}
        {%if formSetDelimited %} <tr style='background-color:white; height='10'><td colspan='2' style='background-color:white; height='10'></td></tr> {% endif %}       
    {% endfor %}
    {% if formset %}
    <tr><td>
	<input type="submit" value="Enviar dades">
	</td></tr>
	{% endif %}
</table>
</form>
{% block postform  %}

{% endblock %}
{% endblock %}


